package com.party.controller.user.myparty;

import com.party.model.SysUser;
import com.party.parBean.UserMsg;
import com.party.service.news.NewsService;
import com.party.service.sys.SysUserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * Created with IntelliJ IDEA.
 * User: beyond
 * Date: 14-10-8
 * Time: 下午10:27
 * To change this template use File | Settings | File Templates.
 */

@Controller
@RequestMapping(value = "/myparty")
public class MyPartyController {

    @Resource
    SysUserService sysUserService;

    /**
     * 党员流程
     */
    @RequestMapping(value = "/flow")
    public ModelAndView flow(
            HttpServletRequest request,
            HttpServletResponse response,
            HttpSession session
    ) {
        ModelAndView modelAndView = new ModelAndView();
        Integer uid=-1;
        if ((SysUser) session.getAttribute("sysUser") != null) {
            uid = ((SysUser) ((SysUser) session.getAttribute("sysUser"))).getUid();
        }
        SysUser user=sysUserService.getUser(uid);
        modelAndView.addObject("user",user);
        modelAndView.setViewName("/user/info/myparty_flow");

        return modelAndView;
    }
}
